-@page_title ='文章管理'
-if notice
  %p#notice.alert.alert-info{role:'alert'}= notice
%h2 文章列表
%a.btn.btn-primary{href:"#{new_article_path}"}
  %i.glyphicon.glyphicon-plus-sign
  发表新文章
%table.table.table-bordered.table-striped
  %thead
    %tr
      %th 文章标题
      %th 创建时间
      %th 操作
  %tbody
    - @articles.each do |article|
      %tr
        %td= link_to article.title, article
        %td= article.created_at.strftime("%Y-%m-%d %H:%M:%S")
        %td
          =link_to '显示', article, class: 'btn btn-primary btn-sm'
          =link_to '编辑', edit_article_path(article), class: 'btn btn-primary btn-sm'
          =link_to '删除', article, method: :delete, data: { confirm: '确定删除？' }, class: 'btn btn-danger btn-sm'
= paginate @articles
%br

%a.btn.btn-primary{href:"#{new_article_path}"}
  %i.glyphicon.glyphicon-plus-sign
  发表新文章
